<?php
function smarty_function_substr($params, &$smarty){
	if(empty($params['start'])) $params['start'] = 0;
	return empty($params['length']) ? substr($params['value'], $params['start']) : substr($params['value'], $params['start'], $params['length']);
}